<?php
namespace app\payqr\model;
use app\BaseModel;
class PayqrCarousel extends BaseModel
{
    protected $name = 'lb_pay_qr_carousel';


   public function getlist($where,$page=1,$list_rows=10){
      $data = $this->where($where)->order('top desc,create_time desc')->field('id,img,top,create_time,status')->paginate( [ 'list_rows' => $list_rows, 'page' => $page ])->toArray();
      $data = transImagesOne($data, ['img']);
       return $data;
   }


   public function onPageLsit($where){
       $data = $this->where($where)->order('top desc,create_time desc')->field('id,img,top,create_time,status')->select()->toArray();
       $data = transImagesOne($data,['img']);
       if(!empty($data)){
           foreach ($data as &$v){
               $v['cover'] = $v['img'];
           }
       }

       return $data;
   }
   public function getinfo($where){
       $data = $this->where($where)->find();
       if($data){
           $data = $data->toArray();
           $data = transImagesOne($data,['img']);
       }
       return $data;
   }
}